import request from'@/utils/request.js'

//================================================用户部分==============================
// 获取token
export const gettoken = params => {
	return request.post({url: '/anonym/token/',data:params})
}
// 获取token
export const gettokenrefresh = params => {
	return request.post({url: '/anonym/token/refresh/',data:params})
}
// 获取token
export const gettokenverify = params => {
	return request.post({url: '/anonym/token/verify/',data:params})
}


// 登录 
export const login = params => {
	return request.post({url: '/anonym/userauth/login/', data:params})
}
// 获取用户信息
export const getUserInfo = () => {
	return request.get({url: '/granted/userinfo/'})
}

//================================================设备部分==============================
// 获取设备信息
export const getDeviceInfo = () => {
	return request.get({url: '/anonym/wdzs/deviceinfo/'})
}

//================================================订单部分==============================
// 获取订单信息
export const getOrderInfo = (params) => {
	return request.get({url: '/granted/wdzs/order/',data:params})
}

// 生成订单 
export const createOrder = params => {
	return request.post({url: '/granted/wdzs/order/', data:params})
}
// 获取订单流水（获取支付信息，拉起支付） 
export const postpayment_detail = params => {
	return request.post({url: '/granted/wdzs/payment_detail/', data:params})
}
//获取超时订单信息
export const getTimeoutOrderInfo = () => {
	return request.get({url: '/granted/wdzs/timeout_order/'})
}
//获取商品信息获取 clazz 套餐类型：门店套餐1，AI教练套餐2，视频套餐3
export const getCommodity= params => {
	return request.get({url: '/anonym/wdzs/commodity/', data:params})
}


//训练成绩获取 ==? 练车记录
export const getachievement= params => {
	return request.get({url: '/granted/wdzs/achievement/', data:params})
}

// 获取是否登录了
export const getlineqrcode= params => {
	return request.get({url: '/anonym/wdzs/lineqrcode/', data:params})
}


// 获取是否登录了
export const getorderqrcode= params => {
	return request.get({url: '/granted/wdzs/orderqrcode/', data:params})
}
// 获取消费信息（登录设备、退出登录）


export const getconsumption= params => {
	return request.get({url: '/granted/wdzs/consumption/', data:params})
}
export const postconsumption= params => {
	return request.post({url: '/granted/wdzs/consumption/', data:params})
}

// 获取考场
export const getGroundList= params => {
	return request.get({url: '/anonym/wdzs/ground/', data:params})
}
// 获取城市
export const getcityList= () => {
	return request.get({url: '/anonym/wdzs/city/'})
}


// 判断是否是教练
export const getinstructor= params => {
	return request.get({url: '/granted/wdzs/instructor/',data:params})
}
// 判断是否是教练
export const getUserinfo= ()=> {
	return request.get({url: '/granted/userinfo/'})
}
// 获取验证码
export const postcaptcha= params => {
	return request.post({url: '/anonym/userauth/smscaptcha/',data:params})
}
// 获取验证码
export const postregister= params => {
	return request.post({url: '/anonym/userauth/register/',data:params})
}
// // 手机号验证码等
// export const postlogin= params => {
// 	return request.post({url: '/anonym/userauth/login/',data:params})
// }

// 获取验证码
export const getcommodityqrcode= params => {
	return request.get({url: '/granted/wdzs/commodityqrcode/',data:params})
}

// 学员获取我的教练
export const getmyinstructor= params => {
	return request.get({url: '/granted/wdzs/myinstructor/'})
}
// 教练获取我的学员
export const getmytrainee= params => {
	return request.get({url: '/granted/wdzs/mytrainee/'})
}

